<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>chinese 汉化工具</title>

<link rel="stylesheet"
	href="<?php echo base_url("src/blueprint/screen.css"); ?>"
	type="text/css" media="screen, projection">
<link rel="stylesheet"
	href="<?php echo base_url("src/blueprint/print.css"); ?>"
	type="text/css" media="print">

</head>
<body>

	<div class="container">
		<h1>数据库选择</h1>

		<form method="post" action="<?php echo site_url("chinese/run"); ?>">

			<fieldset>

				<legend> 详细配置 </legend>

				<div>
					<div class="span-5">
						<label for="from_db">来源数据</label> <select id="from_db"
							name="from_db">
							<?php
							foreach ($from_db as $db) {
									echo "<option value='$db'>$db</option>\n";
								}
								?>
						</select>
					</div>

					<div class="span-5">
						<label for="to_db">目标数据</label> <select id="to_db" name="to_db">
							<?php
							foreach ($to_db as $db) {
									echo "<option value='$db'>$db</option>\n";
								}
							?>
						</select>
					</div>

				</div>

				<br />
				<div>
					<input id="submit" type="submit" value="开始汉化">
				</div>
				
				<br /><br />
				<div >
					<label for="rule">汉化结构规则</label>
					<?php
					$idx = 0;
					$replace = isset($replace) ? intval($replace) : 0;

					echo '<input type="radio" '.($idx == $replace ? 'checked="true"':'').' name="replace" value="'. $idx++ .'">结构不变&nbsp;';
					echo '<input type="radio" '.($idx == $replace ? 'checked="true"':'').' name="replace" value="'. $idx++ .'">添加汉化&nbsp;';
					?>
					
					&nbsp;&nbsp;
					<label for="rule">汉化替换规则</label>
					<?php
					$idx = 0;
					$rule = isset($rule) ? intval($rule) : 0;

					echo '<input type="radio" '.($idx == $rule ? 'checked="true"':'').' name="rule" value="'. $idx++ .'">更新汉化&nbsp;';
					echo '<input type="radio" '.($idx == $rule ? 'checked="true"':'').' name="rule" value="'. $idx++ .'">保持不变&nbsp;';
					echo '<input type="radio" '.($idx == $rule ? 'checked="true"':'').' name="rule" value="'. $idx++ .'">较长汉化&nbsp;';
					echo '<input type="radio" '.($idx == $rule ? 'checked="true"':'').' name="rule" value="'. $idx++ .'">较短汉化&nbsp;';
					?>
				</div>

				<input type="hidden" name="status"
					value="<?php
					if (isset($status))
						echo htmlentities($status);
					?>" /> <br />
				<div>
					<?php
					if (isset($message))
						echo $message;
					?>
				</div>
			</fieldset>
		</form>
	</div>

</body>

<?php if(isset($refresh)): ?>
<script language="JavaScript" type="text/javascript">
		setTimeout("document.getElementById('submit').click();", 3000);
	</script>
<?php endif; ?>

</html>
